package com.inspur.his.service.impl;

import com.inspur.his.mapper.PayStandarMapper;
import com.inspur.his.pojo.PayStandard;
import com.inspur.his.service.PayStandardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;

@Service
public class PayStandarServiceImpl implements PayStandardService {

    @Autowired
    private PayStandarMapper payStandarMapper;

    @Override
    public void add(PayStandard payStandard) {
        payStandarMapper.add(payStandard);
    }

    @Override
    public List<PayStandard> show(String code, int currPage, int pageSize) {
        HashMap map = new HashMap<>();
        int startNum = (currPage - 1) * pageSize;
        map.put("startNum", startNum);
        map.put("pageSize", pageSize);
        map.put("code", code);
        return payStandarMapper.show(map);
    }

    @Override
    public int count(String code) {
        HashMap map = new HashMap<>();
        map.put("code", code);
        return payStandarMapper.count(map);
    }

    @Override
    public void delete(Integer id) {
        payStandarMapper.delete(id);
    }

    @Override
    public void update(PayStandard payStandard) {
        payStandarMapper.update(payStandard);
    }

    @Override
    public PayStandard getOneById(Integer id) {
        return payStandarMapper.getOneById(id);
    }
}
